<?php

namespace Modules\Admin\Entities;

use Illuminate\Database\Eloquent\Model;

class Module extends Model
{
    protected $fillable = ['title','name','is_default','home_access'];
    public function setDfaulet(){
        //将当前所有模块的is_default设置为0;
        \DB::table('modules')->update(['is_default'=>0]);
        //将当前的模块数据is_default设置为1
        $this->is_default = 1;
        $this->save();
    }
}
